package com.csdj.crm.controller;

import com.csdj.crm.base.BaseController;
import com.csdj.crm.query.CustomerQuery;
import com.csdj.crm.service.CustomerOrderService;
import com.csdj.crm.service.CustomerService;
import com.csdj.crm.vo.Customer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("customer")
public class CustomerController extends BaseController {
    @Resource
    private CustomerService customerService;

    @Resource
    private CustomerOrderService customerOrderService;

    @RequestMapping("index")
    public String index(){

        return "customer/customer";
    }

    /**
     * 客户信息管理查询
     * @param customerQuery
     * @return
     */
    @RequestMapping("list")
    @ResponseBody
    public Map<String,Object> queryCustomersByParams(CustomerQuery customerQuery){
        return customerService.queryByParamsForTable(customerQuery);
    }
}
